<?php

	class DataGridWidget extends EbWidget
	{
		public function render()
		{
			$dataProvider = $this->dataProvider;
			$columns = $this->columns;
			
			echo '<table class="eb-datagrid"><tr>';
							
			foreach ($columns AS $item)
			{
				echo '<th>'.$item->headerText.'</th>';
			}
			
			echo '</tr>';	
						
			foreach($dataProvider AS $item)
			{
				echo '<tr>';
				
				foreach ($columns AS $column)
				{
					echo '<td>';
					
					if (!isset($column->itemRenderer))
					{
						$labelField = $column->labelField;
						echo $item->$labelField;
					}
					else
					{
						echo parent::evalItemRenderer($item,$column->itemRenderer);
					}
					
					echo '</td>';				
				}
				
				echo '</tr>';
			}
			
			echo '</tr></table>';
		}	
	}

?>